package cn.lbd.api.designMode.proxy.dynamicproxy.rent;

public class Client {
    public static void main(String[] args) {
        //真实角色
        Host host=new Host();
        ///代理对象，目前是空的
        ProxyInvocationHandler proxyInvocationHandler=new ProxyInvocationHandler();
        proxyInvocationHandler.setRent(host);
        //与真实对象实现相同接口
        Rent proxy = (Rent) proxyInvocationHandler.getProxy();
        //proxy.rent();
        proxy.buy(1000d);
    }
}
